/**
 * @Author Fish Paradise
 * @Description
 * @Date 2019/1/18  16:32
 **/
public class LazySingleton {
    private static LazySingleton lazySingleton = null;

    private LazySingleton(){}

    public static LazySingleton getInstance(){
        if (lazySingleton == null){
            synchronized (LazySingleton.class){
                if (lazySingleton == null){
                    lazySingleton = new LazySingleton();
                }
            }
        }
        return lazySingleton;
    }

    public void speak(){
        System.out.println("这是懒汉模式");
    }

}
